package sist.erp.model.Insa;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import sist.erp.db.Insa.DeptManager;
import sist.erp.db.Insa.JobManager;

@Controller
public class SController {

	private DeptManager deptDAO;
	private JobManager jobDAO;
	
	public void setDeptDAO(DeptManager deptDAO) {
		this.deptDAO = deptDAO;
	}

	public void setJobDAO(JobManager jobDAO) {
		this.jobDAO = jobDAO;
	}

	@RequestMapping("insa/sal.erp")
	public ModelAndView sal() throws Exception{
		ModelAndView mav = new ModelAndView();
		mav.addObject("location","/insa/sal.jsp");
		mav.addObject("deptList", deptDAO.deptAllData());
		mav.addObject("jobList", jobDAO.jobAllData());
		mav.setViewName("main/main");
		return mav;
	}
}
